package com.xja.mapper;

import com.xja.pojo.Permissions;
import com.xja.pojo.PermissionsExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PermissionsMapper {

    @Select("select p.* from roles r left join role_permission rp on(r.id=rp.roles)\n" +
            "left join permissions p on(rp.permissions=p.id) where r.id=#{id}")
    List<Permissions> findPermissionByRoleId(@Param("id")Integer id);

    int countByExample(PermissionsExample example);

    int deleteByExample(PermissionsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Permissions record);

    int insertSelective(Permissions record);

    List<Permissions> selectByExample(PermissionsExample example);

    Permissions selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Permissions record, @Param("example") PermissionsExample example);

    int updateByExample(@Param("record") Permissions record, @Param("example") PermissionsExample example);

    int updateByPrimaryKeySelective(Permissions record);

    int updateByPrimaryKey(Permissions record);
}